﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace CodeStash.Addin.ValueConverters
{
    public class EnumToBoolConverter : IValueConverter
    {
        private static Lazy<EnumToBoolConverter> instance = new Lazy<EnumToBoolConverter>(() => new EnumToBoolConverter());

        private EnumToBoolConverter()
        {

        }

        static EnumToBoolConverter()
        {

        }


        public static EnumToBoolConverter Instance
        {
            get { return instance.Value; }
        }


        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (parameter.Equals(value.ToString()))
                return true;
            else
                return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return parameter;
        }
        #endregion



    }
}
